
cmake_minimum_required(VERSION 3.5.1)

project(android-adb-fastboot-tools LANGUAGES CXX VERSION 0.3.3)

include(cmake/SparkWithGit.cmake)
spark_initialize_modules()
include(cmake/AndroidPlatformTools.cmake)   # 采用外部支持的 platform-tools (目前仅 Linux x86_64可用), 在安装时由 debian 安装脚本进行处理

# 资源文件路径
set(QRC_SOURCES "")

spark_add_executable_path(${PROJECT_NAME} src
    ${QRC_SOURCES}
)
target_link_qt5(${PROJECT_NAME})

spark_framework_include_with_git(${PROJECT_NAME}
    https://gitee.com/spark-framework-libs/spark-framework-features
    FEATURES version
)

spark_add_executable_paths(test
    tests/filepath
)
spark_framework_include_with_git(test-tests-filepath
    https://gitee.com/spark-framework-libs/spark-framework-features
    FEATURES qd
)

# desktop 生成宏
spark_desktop_macros(
    # 应用名称: Name=    
    "${PROJECT_NAME}" 
    # 应用名称: Name[zh_CN]=
    "Android - adb/fastboot 测试工具"
    # 应用说明: Comment=
    "基于 adb/fastboot 命令的图形化工具，可用于简单的基于 AOSP 镜像刷机测试"
    # 应用类型: Type=
    "Application"
    # 执行程序: Exec=
    /usr/share/${PROJECT_NAME}/${PROJECT_NAME}
    # 图标路径: Icon=
    /usr/share/${PROJECT_NAME}/icon.png 
    # 应用分类: Category=
    "Utility"
)

# 资源安装路径
install(TARGETS ${PROJECT_NAME}
    DESTINATION /usr/share/${PROJECT_NAME}/)
spark_install_file(/usr/share/${PROJECT_NAME}/
    assets/icon.png)
spark_install_file(/usr/share/applications/
    build/android-adb-fastboot-tools.desktop)

add_package_descript(cmake/spark-deb-package.descript)

# 1. 在顶层构建中导入 Appimage 的构建
add_appimage_icon(assets/icon.png)        # 添加到 Appimage 中的默认的图标
add_appimage_desktop()                    # 添加到 Appimage 中的默认desktop(使用来自 Spark 构建的 Desktop 构建中配置的信息(必须要求 spark-desktop))
add_appimage_target(${PROJECT_NAME})      # 应用对 Appimage 的构建
